var size = function () {
    var ow = document.documentElement.clientWidth;
    var oh = document.documentElement.clientHeight;
    var isPhone = /Android|webOS|iPhone|iPad|BlackBerry/i.test(navigator.userAgent)
    if (isPhone) {
        if (ow > 540 && ow < 900) {
            ow = 540
        } else if (ow >= 900) {
            ow = 750
        }
    } else {
        ow = 540
    }
    var size = 100 * ow / 375
    window.document.documentElement.style.fontSize = size + "px";
}
size();
window.onresize = function () {
    size();
}